package com.boge.auth.util;

import org.apache.commons.lang3.StringUtils;

public class LevelUtil {

    //分隔符
    public static final String SEPARATOR = ".";

    public static final String ROOT = "0";

    //0
    //0.1
    //0.2
    //0.2.1
    public static String calculateLevel(String parentLevel, Integer parentId) {
        if (StringUtils.isBlank(parentLevel)) {
            return ROOT;
        }
        return StringUtils.join(parentLevel, SEPARATOR, parentId);
    }

}
